package com.example.unisys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.unisys.entity.Student;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Repository
public interface StudentMapper  extends BaseMapper<Student> {

    int insert(Student stu);

    int insertSelective(Student stu);

    int update(Student stu);

    int updatetag(@Param("exam_id") long exam_id, @Param("newtag") String newtag);


    //根据分页获取
    List<Student> getAllStudent(@Param("start") int start, @Param("pagesize") int pagesize, @Param("main_school") String main_school, @Param("sub_school") String sub_school);

    Integer getStuNum(@Param("main_school") String main_school, @Param("sub_school") String sub_school);

    Integer getMainStuNum(@Param("main_school") String main_school);

    Integer getAllStuNum();

    Integer getTagNum(@Param("tag") String tag, @Param("main_school") String main_school, @Param("sub_school") String sub_school);

    List<Student> getByTag(@Param("tag") String tag, @Param("start") int start, @Param("pagesize") int pagesize, @Param("main_school") String main_school, @Param("sub_school") String sub_school);

    Student getByIdcard(@Param("id_card") String id_card, @Param("main_school") String main_school, @Param("sub_school") String sub_school);


    List<Student> getByPhone(@Param("phone") String phone);

    List<Student> getByName(@Param("real_name") String real_name);

    List<Student> getByPhoneMain(@Param("phone") String phone, @Param("main_school") String main_school);

    List<Student> getByNameMain(@Param("real_name") String real_nam, @Param("main_school") String main_school);

    List<Student> getMainStu(@Param("main_school") String main_school, @Param("start") int start, @Param("page") int pagesize);

    List<Student> getSubStu(@Param("main_school") String main_school, @Param("sub_school") String sub_school, @Param("start") int start, @Param("page") int page);

    Student getById(@Param("exam_id") String exam_id);

    int delete(@Param("exam_id") String exam_id);

    List<Student> getSysStu(@Param("start") int start, @Param("pagesize") int pagesize);

    Student getByUsername(@Param("username") String username);

    List<Student> getByMainTag(@Param("tag") String tag, @Param("main_school") String main_school, @Param("start") int start, @Param("pagesize") int pagesize);

    Integer getByMainTagSum(@Param("tag") String tag, @Param("main_school") String main_school);

    Student getPassword(Map map);


    Student searchStudent(HashMap<String, Object> hs);

    List<Student> getSystemStudents(HashMap<String, Object> hs);

    List<Student> getSystemStudentsByTag(HashMap<String, Object> hs);

    int getSysStuNumByTag(HashMap<String, Object> hs);

    List<Student> getSystemSupervise(HashMap<String, Object> hs);

    Integer getStuSum(HashMap<String, Object> hs);

    int getAllStuCurTag(HashMap<String, Object> hs);

    List<Map<String, Object>> getSuperviseFile(HashMap<String, Object> hs);

    Integer getSystemSuperviseSum(HashMap<String, Object> hs);
}